package com.boot.dto;

import lombok.Data;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;

@Data
public class QuestionDetailDTO {
    private Long id;
    private String title;
    private String type;
    private String description;
    private String expected;
    private String status;
    private LocalDateTime createdAt;
    private LocalDateTime resolvedAt;
    private List<AttachmentDTO> attachments; // 嵌套附件信息

    private List<UserSummaryDTO> pendingExperts;

    public String getCreatedAt() {
        return this.createdAt != null ? this.createdAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) : "";
    }

    public String getResolvedAt() {
        return this.resolvedAt != null ? this.resolvedAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) : "";
    }
}
